package com.example.dee.dao;

import com.example.dee.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @ClassName UserDao
 * @Author zyf
 * @Date 2022/7/20 0018 10:52
 * @Version
 **/

@Mapper
@Repository
public interface LoginDAO {

    @Select("select password from t_sys_user where username= #{username}")
    String selectPassword(String username);

    @Select("select count(username) from t_sys_user where username=#{username}")
    int checkUser(String username);

    @Insert("insert into t_sys_user (username,password,name,role) values(#{username},#{password},#{name},#{role})")
    Boolean register(User user);
}
